﻿Public Class frmMaterialManage

  Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
    Dim SQLString As String = ""
    Dim fMaterial As frmMaterialDetail = New frmMaterialDetail()
    fMaterial.Text = "Thêm Nguyên Liệu"
    fMaterial.ShowDialog(Me)
    If (fMaterial.DialogResult = Windows.Forms.DialogResult.OK) Then
      If fMaterial.AddMaterial() = True Then
        'LoadPartsonGrid()
        Dim FuntionandSubObj As FuntionandSub = New FuntionandSub()
        'FuntionandSubObj.HighlightRow(Me.dgvMaterialList, CurrentPartNumber)

        'dgridviewPartsList_CellClick(Me.dgvMaterialList, Nothing)
      End If
    End If

    If dgvMaterialList.Rows.Count > 0 Then
      btnEdit.Enabled = True
      btnDelete.Enabled = True
      btnPrint.Enabled = True
    Else
      btnEdit.Enabled = False
      btnDelete.Enabled = False
      btnPrint.Enabled = False
    End If
  End Sub
End Class